package ysq.xyg.host.model.po;

import lombok.Data;
import lombok.NoArgsConstructor;
import ysq.xyg.base.util.BaseConstant;
import ysq.xyg.base.util.BaseUtil;
import ysq.xyg.sys.model.po.SysUser;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;

/**
 * 房产模块-佣金记录实体类
 *
 * @author shengQiang yu
 * @date 2019-7-5 22:09:25
 */
@Data
@NoArgsConstructor
@Table(name = "xyg_host_detail")
public class HostDetail implements Serializable {

    /**
     * 主键
     */
    @Id
    private String id;

    /**
     * 会员id
     */
    @Column(name = "member_id")
    private String memberId;

    /**
     * 报备记录
     */
    @Column(name = "report_id")
    private String reportId;

    /**
     * 佣金
     */
    @Column(name = "fee_money")
    private String feeMoney;

    /**
     * 总金额
     */
    @Column(name = "all_money")
    private String allMoney;

    /**
     * 描述
     */
    @Column(name = "descripts")
    private String descripts;

    /**
     * 状态是否领取
     */
    @Column(name = "status")
    private String status;

    /**
     * 领取时间
     */
    @Column(name = "draw_time")
    private Date drawTime;

    /**
     * 删除标识：1、正常，2、已删除
     */
    @Column(name = "remove_tag")
    private String removeTag;

    /**
     * 创建人
     */
    @Column(name = "create_user")
    private String createUser;

    /**
     * 创建时间
     */
    @Column(name = "create_time")
    private Date createTime;

    /**
     * 修改人
     */
    @Column(name = "update_user")
    private String updateUser;

    /**
     * 修改时间
     */
    @Column(name = "update_time")
    private Date updateTime;

    /**
     * 小区名称
     */
    @Transient
    private String itemName;

    /**
     * 客户姓名
     */
    @Transient
    private String couserName;

    /**
     * 客户电话
     */
    @Transient
    private String couserPhone;

    /**
     * 卡号
     */
    @Transient
    private String cardNo;

    /**
     * 昵称
     */
    @Transient
    private String nickName;

    /**
     * 头像
     */
    @Transient
    private String headImage;

    /**
     * 手机号
     */
    @Transient
    private String phone;

    /**
     * 时间
     */
    @Transient
    private String createTimeStr;

    /**
     * 姓名
     */
    @Transient
    private String name;

    public HostDetail(SysUser sysUser) {
        this.id = BaseUtil.uId();
        this.removeTag = BaseConstant.BASE_REMOVE_TAG_NORMAL;
        this.createTime = new Date();
        this.createUser = sysUser.getId();
        this.updateTime = new Date();
        this.updateUser = sysUser.getId();
    }
}